package com.fast.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.fast.pojo.entity.SysAuthorityDo;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @author Administrator
 * @description 针对表【sys_authority(权限信息表)】的数据库操作Mapper
 * @fileName com.fast.pojo.entity.SysAuthorityDo
 * @since 2024-06-23 09:44:12
 */
@Mapper
public interface SysAuthorityMapper extends BaseMapper<SysAuthorityDo> {
    /**
     * delete by primary key
     *
     * @param authorityId primaryKey
     * @return deleteCount
     */
    int deleteByPrimaryKey(String authorityId);

    /**
     * insert record to table
     *
     * @param record the record
     * @return insert count
     */
    int insert(SysAuthorityDo record);

    /**
     * insert record to table selective
     *
     * @param record the record
     * @return insert count
     */
    int insertSelective(SysAuthorityDo record);

    /**
     * select by primary key
     *
     * @param authorityId primary key
     * @return object by primary key
     */
    SysAuthorityDo selectByPrimaryKey(String authorityId);

    /**
     * update record selective
     *
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKeySelective(SysAuthorityDo record);

    /**
     * update record
     *
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKey(SysAuthorityDo record);

    /**
     * 通过用户Id获取权限结合（权限 + 菜单路由）
     * @param userId 用户ID
     * @return
     */
    List<SysAuthorityDo> getAuthoritiesByUserId(String userId);
}




